package com.xm;

import java.util.Base64;

/**
 * @Author：xm
 * @Project：runoob
 * @Date：2024/7/23 20:30
 */

public class Lambda10 {
    public static void main(String[] args) {

        Swimming10 swimming = new Swimming10() {
            @Override
            public void swim() {
                System.out.println("111");
            }
        };
        swimming.swim();

        new Swimming10() {
            @Override
            public void swim() {
                System.out.println("222");
            }
        }.swim();

        /*代码块只有一条语句，可以省略代码块的花括号
        Swimming swimming333 = () -> {
            System.out.println("333");
        };*/
        Swimming10 swimming3 = () -> System.out.println("3");
        swimming3.swim();


        ((Swimming10) () -> System.out.println("444")).swim();

    }
}


